<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>投票管理</title>
		<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/default/easyui.css" />
		<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/icon.css" />
		<script type="text/javascript" src="<%=basePath %>js/jquery-2.1.1.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/vote.js"></script>
		<style type="text/css">
			#toolbar{height: 40px;}
			#toolbar a{margin-left: 80%;margin-top: 0.5%;}
		</style>
		<script type="text/javascript">
			$(function(){
				$('#dg').datagrid({    
				    url : "<%=basePath %>liu/loadEmpList.action", 
				    pagination : true,
				    queryParams : {pageNo : 1, pageSize : 10,searchDeptId:-1,searchEmpName:""},
				    rownumbers : true,
				    frozenColumns : [[{field:'hahaha',width:50,checkbox:true}]],
				    striped : true,
				    columns:[[    
				        {field:'empid',title:'员工编号',width:100,hidden:true},    
				        {field:'empName',title:'员工姓名',width:200},  
				        {field:'d_name',title:'部门名称',width:100,align:'left'},
				        {field:'deptId',title:'部门编号',width:100,align:'left',hidden:true},   
				        {field:'salary',title:'工资',width:200,align:'left',
				        	/* styler: function(value,row,index){
								if (value > 5000){
									return 'color:red;';
								}
							} */
				        	formatter: function(value,row,index){
								if (value >= 5000){
									return "<b style='color:red;'>" + value + "</b>";
								} else {
									return value;
								}
							}

				        }  
				    ]],
				    toolbar:"#toolbar"
				});
				var page = $("#dg").datagrid("getPager");
				page.pagination({
					onSelectPage:function(pageNumber, pageSize){
						/* $("#dg").pagination('loading'); */
						$("#dg").datagrid("load",{pageNo : pageNumber,pageSize : pageSize});
						/* $("#dg").pagination('loaded'); */
						page.pagination({
							pageNumber : pageNumber,
							pageSize : pageSize,
							searchDeptId:-1,
							searchEmpName:""
						});
					}
				});
				
				
				
			});
		</script>
	</head>
	<body>
		<table id="dg"></table>
		<div id="toolbar">
			<a href="javascript:addEmp();" class="easyui-linkbutton" data-options="iconCls:'icon-add2'" style="text-align: center;">新增</a> 
		</div>
	</body>
</html>
